<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title></title>
</head>

<body>
<script>

var s ="<h1>title<h1><p>text<p>";
var r = /((<\/?\w+>).*\2)/g;
var a = s.match(r); 		// 返回数组["<h1>title<h1>" , "<p>text<p>"]


</script>
</body>
</html>
